<?php
/**
 * Created by IntelliJ IDEA.
 * User: HXL
 * Date: 2018/7/10
 * Time: 14:26
 */
namespace app\order\sms;

use Qcloud\Sms\SmsSingleSender;
/**
 * 腾讯云短信接口
 * Class Sms
 * @package app\order\sms
 */
class Sms {
    private static $APPID = 'XXX';
    private static $APPKEY = 'XXX';
    /**
     * 模板id
     * @var string
     */
    private static $TPLID = '1234';

    public static function sends($phone, $num, $status){
        $params = array($num,$status);
        $tel = $phone;
        $sender = new SmsSingleSender(Sms::$APPID, Sms::$APPKEY);
        //默认发送中国号码
        $result = $sender->sendWithParam('86', $tel, Sms::$TPLID, $params,
            $sign = "", $extend = "", $ext = "");
        $result = json_decode($result);
        return $result;
    }
    
    private function SHA256($str){
        $re = hash('sha256', $str, true);
        return $re;
    }


}